/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: MENG
 * Date: 2022-06-24
 * Time: 23:12
 */
/*
class Food {

}
class Fruit extends Food {

}
class Apple extends Fruit {

}
class Banana extends Fruit {

}

class Test14 <T> { // 设置泛型
    private T val ;

    public T getVal() {
        return val;
    }

    public void setVal(T val) {
        this.val = val;
    }

}
public class Test3 {
    public static void main(String[] args) {
        Test14<Apple> test1 = new Test14<>() ;
        test1.setVal(new Apple());

        fun(test1);

        Test14<Banana> test2 = new Test14<>();
        test2.setVal(new Banana());

        fun(test2);
    }
    public static void fun(Test2 <? extends Fruit> tmp){
//        tmp.setVal();
        tmp.getVal();

    }
}*/
